﻿<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link href="../static/h-ui/css/H-ui.min.css" rel="stylesheet"
          type="text/css"/>
    <link href="../static/h-ui.admin/css/H-ui.login.css" rel="stylesheet"
          type="text/css"/>
    <link href="../static/h-ui.admin/css/style.css" rel="stylesheet"
          type="text/css"/>
    <link href="../static/lib/Hui-iconfont/1.0.8/iconfont.css"
          rel="stylesheet" type="text/css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>后台登录 - 重庆信元达</title>
    <meta name="keywords" content="重庆信元达 智慧工地 管理后台">
    <meta name="description" content="重庆信元达 智慧工地 管理后台">
</head>
<body>
<div class="loginWraper" id="container">
    <div id="output">
    </div>
    <div id="bgContainer">
        <div id="loginContainer">
            <div id="loginformBg"></div>
            <div id="loginformContainer" class="loginBox">
                <div class="logo"></div>
                <form class="form form-horizontal" id="form-login" name="form-login">
                    <div class="row cl">
                        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                        <div class="formControls col-xs-8">
                            <input id="adminId" name="adminId" type="text" placeholder="账户"
                                   class="input-text size-L">
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                        <div class="formControls col-xs-8">
                            <input id="adminPassword" name="adminPassword" type="password"
                                   placeholder="密码" class="input-text size-L">
                        </div>
                    </div>
                    <div class="row cl">
                        <div class="formControls col-xs-8 col-xs-offset-3">
                            <input name="" type="submit"
                                   class="btn btn-success radius size-L"
                                   value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;"> <input
                                name="" type="reset" class="btn btn-default radius size-L"
                                value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="footer footerBg"></div>
<div class="footer">Copyright © 重庆信元达 保留所有权利</div>
<div th:replace="_footer :: foot"></div>
<script type="text/javascript" src="../static/lib/vector.js"></script>
<script type="text/javascript">
    $(function () {
        Victor("container", "output"); //登陆背景函数
        //表单验证
        $("#form-login").validate({
            rules: {
                adminId: {
                    required: true,
                },
                adminPassword: {
                    required: true,
                }
            },
            messages: {
                adminId: {
                    required: "账户不能为空"
                },
                adminPassword: {
                    required: "密码不能为空"
                }
            },

            onkeyup: false,
            focusCleanup: false,
            success: "valid",
            submitHandler: function (form) {
                ajaxSubmit();
            }

        });

        function ajaxSubmit() {
            $.ajax({
                type: 'POST',

                dataType: 'json',
                data: $('#form-login').serialize(),
                url: "loginCheck",
                success: function (data) {
                    if (data.success) {
                        window.location.href = "../";
                    } else {
                        alert(data.error);
                    }
                }
            });
            return false;
        }
        ;
    });
</script>
</body>
</html>